package cn.flying.cloud.message.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;

import cn.flying.cloud.message.bo.MsgStorageBo;

/**
 * 消息配置信息表
 *
 * @author admin
 * @since 2025-09-24 10:42:07
 */
@TableName("msg_storage")
public class MsgStorage implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 类型 短信SMS  邮件EMAIL
     */
    @TableField("msg_type")
    private String msgType;

    /**
     * 服务器/访问端点
     */
    @TableField("endpoint")
    private String endpoint;

    /**
     * 账户/访问KEY
     */
    @TableField("access_key")
    private String accessKey;

    /**
     * 授权码/密钥KEY
     */
    @TableField("secret_key")
    private String secretKey;

    /**
     * 协议
     */
    @TableField("protocol")
    private String protocol;

    /**
     * 端口
     */
    @TableField("port")
    private Integer port;

    /**
     * 是否STARTTLS
     */
    @TableField("is_starttls")
    private String isStarttls;

    /**
     * 是否SSL协议
     */
    @TableField("is_ssl")
    private String isSsl;

    /**
     * 使用状态
     */
    @TableField("status")
    private String status;

    /**
     * 是否默认
     */
    @TableField("is_default")
    private String isDefault;

    /**
     * 厂商编码
     */
    @TableField("vendor_code")
    private String vendorCode;

    /**
     * 厂商名称
     */
    @TableField("vendor_name")
    private String vendorName;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    /**
     * 修改人
     */
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 修改时间
     */
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

    /**
     * 租户ID
     */
    @TableField("tenant_id")
    private String tenantId;

    /**
     * 乐观锁版本号
     */
    @TableField(value = "revision", fill = FieldFill.INSERT)
    @Version
    private Long revision;

    /**
     * 删除标识
     */
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @TableLogic
    private String deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getIsStarttls() {
        return isStarttls;
    }

    public void setIsStarttls(String isStarttls) {
        this.isStarttls = isStarttls;
    }

    public String getIsSsl() {
        return isSsl;
    }

    public void setIsSsl(String isSsl) {
        this.isSsl = isSsl;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(String isDefault) {
        this.isDefault = isDefault;
    }

    public String getVendorCode() {
        return vendorCode;
    }

    public void setVendorCode(String vendorCode) {
        this.vendorCode = vendorCode;
    }

    public String getVendorName() {
        return vendorName;
    }

    public void setVendorName(String vendorName) {
        this.vendorName = vendorName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public Long getRevision() {
        return revision;
    }

    public void setRevision(Long revision) {
        this.revision = revision;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "MsgStorage{" +
                "id = " + id +
                ", msgType = " + msgType +
                ", endpoint = " + endpoint +
                ", accessKey = " + accessKey +
                ", secretKey = " + secretKey +
                ", protocol = " + protocol +
                ", port = " + port +
                ", isStarttls = " + isStarttls +
                ", isSsl = " + isSsl +
                ", status = " + status +
                ", isDefault = " + isDefault +
                ", vendorCode = " + vendorCode +
                ", vendorName = " + vendorName +
                ", remark = " + remark +
                ", createdBy = " + createdBy +
                ", createdTime = " + createdTime +
                ", updatedBy = " + updatedBy +
                ", updatedTime = " + updatedTime +
                ", tenantId = " + tenantId +
                ", revision = " + revision +
                ", deleted = " + deleted +
                "}";
    }

    public MsgStorageBo toBO() {
        MsgStorageBo bo = new MsgStorageBo();
        bo.setId(this.id);
        bo.setMsgType(this.msgType);
        bo.setEndpoint(this.endpoint);
        bo.setAccessKey(this.accessKey);
        bo.setSecretKey(this.secretKey);
        bo.setProtocol(this.protocol);
        bo.setPort(this.port);
        bo.setIsStarttls(this.isStarttls);
        bo.setIsSsl(this.isSsl);
        bo.setStatus(this.status);
        bo.setIsDefault(this.isDefault);
        bo.setVendorCode(this.vendorCode);
        bo.setVendorName(this.vendorName);
        bo.setRemark(this.remark);
        bo.setCreatedBy(this.createdBy);
        bo.setCreatedTime(this.createdTime);
        bo.setUpdatedBy(this.updatedBy);
        bo.setUpdatedTime(this.updatedTime);
        bo.setTenantId(this.tenantId);
        bo.setRevision(this.revision);
        bo.setDeleted(this.deleted);
        return bo;
    }

    public MsgStorage fromBO(MsgStorageBo bo) {
        this.setId(bo.getId());
        this.setMsgType(bo.getMsgType());
        this.setEndpoint(bo.getEndpoint());
        this.setAccessKey(bo.getAccessKey());
        this.setSecretKey(bo.getSecretKey());
        this.setProtocol(bo.getProtocol());
        this.setPort(bo.getPort());
        this.setIsStarttls(bo.getIsStarttls());
        this.setIsSsl(bo.getIsSsl());
        this.setStatus(bo.getStatus());
        this.setIsDefault(bo.getIsDefault());
        this.setVendorCode(bo.getVendorCode());
        this.setVendorName(bo.getVendorName());
        this.setRemark(bo.getRemark());
        this.setCreatedBy(bo.getCreatedBy());
        this.setCreatedTime(bo.getCreatedTime());
        this.setUpdatedBy(bo.getUpdatedBy());
        this.setUpdatedTime(bo.getUpdatedTime());
        this.setTenantId(bo.getTenantId());
        this.setRevision(bo.getRevision());
        this.setDeleted(bo.getDeleted());
        return this;
    }
}
